package com.lee9213.conference.track.management.handler;

import com.lee9213.conference.track.management.constant.Constant;
import com.lee9213.conference.track.management.entity.SessionEntity;
import com.lee9213.conference.track.management.entity.TalkEntity;
import com.lee9213.conference.track.management.entity.TrackEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lee9213@163.com
 * @version 1.0
 * @date 2018-07-11 23:23
 */
public class LunchFilter implements Filter {

    @Override
    public void build(List<TalkEntity> allTalkEntities, TrackEntity trackEntity, FilterChain filterChain) {
//        String startTime = trackEntity.getLastTime();
        SessionEntity lunch = new SessionEntity(Constant.LUNCH_START_TIME, Constant.LUNCH_DURATION);
        List<TalkEntity> lunchTalkEntities = new ArrayList<>();
        lunchTalkEntities.add(new TalkEntity(Constant.LUNCH_TALK_TITLE, Constant.LUNCH_DURATION, Constant.LUNCH_START_TIME));
        lunch.setTalkEntity(lunchTalkEntities);
        trackEntity.addSessionEntity(lunch);
        filterChain.doFilter(allTalkEntities, trackEntity);
    }
}
